In this article, you will learn how to use data
import if your table has a
subform.
For example, we will use two tables:
Products and
Orders.
The orders table will consist of the
order number column and the
Products subform.
Please note that the product column is empty. It is with the help of import that we will add new products to orders.
The product table consists of the
“Name” and
“Price” of the product.
A
mandatory step is to add a field with the "Linked Column" type, in which you need to select a field from the main form (Orders).
It is thanks to this column that we will be able to use import to add, edit or remove products from the order.
Once the form structure has been created and the associated column has been added, we can move on to the next step, namely import.
To do this, you need to go to the
Records page of the
Products table.
Please note that importing subforms can only be used from the Products table.
It is not yet possible to use import in the main table (in our example of Orders).
There is currently no data on the Records page of the Products table:
Click on "Import data from Excel/CSV/TXT" and go to the import page.
Be sure to select the associated column in the
"Linked column to parent form" control and upload your XLS file with the products.
- It is recommended to use files with the extension XLS and CSV. XLSX may have problems with data binding because Excel reports integer data in dotted number format. As an alternative method, you can simply use row fields as a 'linked column'.
- Remember that the names of the columns in the file must completely match the names of the fields in the form. Our file will look like this:
As you can see from the screenshot, we want to load two products into order number 1 and one product into order number 2.
After importing the file, we will see new products in the table associated with the main form.
And also in the orders table, new products appeared in the corresponding orders:
You can use the same file and format to update the data. For example, we will add a new product to the file and transfer all previous products to the second order:
In the product table, you need to click on the “Import” control and select “Update existing records if the key matches.”
On the import page, you need to select a key column with unique data, in our case it is the 'Name' of the product.
After import, all products were moved to the second order:
We hope you find the advanced subform import options useful!